package com.lkd.feign;

import com.lkd.feign.fallback.UserServiceFallbackFactory;
import com.lkd.vo.PartnerVO;
import com.lkd.vo.UserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "user-service",fallbackFactory = UserServiceFallbackFactory.class)
public interface UserServiceFeignClient {

    /**
     * 根据id查询
     * @param id
     * @return 实体
     */
    @GetMapping("/user/{id}")
    UserVO findById(@PathVariable(name = "id") Integer id);

    /**
     * 获取运营员数量
     * @return
     */
    @GetMapping("/user/operaterCount")
    Integer getOperatorCount();

    /**
     * 获取维修员数量
     * @return
     */
    @GetMapping("/user/repairerCount")
    Integer getRepairerCount();


    /**
     * 获取合作商名称
     * @param id
     * @return
     */
    @GetMapping("/partner/{id}")
    PartnerVO getPartner(@PathVariable Integer id);

}
